package com.example.demo.entryWarehouse.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.common.ResponseData;
import com.example.demo.entryWarehouse.entity.BaseInformation;
import com.example.demo.entryWarehouse.service.BaseInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wangxuan
 * @since 2021-05-03
 */
@RestController
@RequestMapping("/entryWarehouse/base-information")
@PreAuthorize("hasAnyAuthority('5', '4','6')")
@CrossOrigin(origins = {"*"})
public class BaseInformationController {
    @Autowired
    private BaseInformationService baseInformationService;

    @GetMapping("/all")
    public ResponseData selectAll() {
        return baseInformationService.selectAll();
    }

    @GetMapping("/search")
    public ResponseData selectByname(@RequestParam("search") String search) {

        return baseInformationService.selectByname(search);
    }

}

